package com.neusoft.bizcore.auth.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import org.hibernate.validator.constraints.Length;

import com.neusoft.bizcore.web.jpa.model.AbstractModel;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Getter
@Setter
@ToString
@Entity
@Table(name = "bizcore_auth_oauth2config")
public class OAuth2Config extends AbstractModel {

    private static final long serialVersionUID = 1L;

    @Length(max = 50, message = "应用名称不能超过{max}位")
    @Column(length = 50, nullable = true)
    private String name;

    @Length(max = 255, message = "应用ID不能超过{max}位")
    @Column(length = 255, nullable = true)
    private String clientId;

    @Length(max = 255, message = "安全ID不能超过{max}位")
    @Column(length = 255, nullable = true)
    private String secretId;

    @Length(max = 255, message = "授权服务地址不能超过{max}位")
    @Column(length = 255, nullable = true)
    private String baseUrl;

    @Length(max = 255, message = "客户端认证地址不能超过{max}位")
    @Column(length = 255, nullable = true)
    private String authorizeUri;

    @Length(max = 255, message = "换取Access Token地址不能超过{max}位")
    @Column(length = 255, nullable = true)
    private String accessTokenUri;

    @Length(max = 255, message = "获取用户信息地址不能超过{max}位")
    @Column(length = 255, nullable = true)
    private String userInfoUri;

    @Length(max = 255, message = "回调地址不能超过{max}位")
    @Column(length = 255, nullable = true)
    private String redirectUrl;
}
